feat(legado): 新增对开源阅读(Legado)Web服务的完整适配 #24
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
你好,前些天我提交了 issue 来请求适配“开源阅读”Web服务
现在我拥有空闲时间,自己进行了适配,现在将完整的实现提交给您审查。
对于原有代码,主要修改了// main 部分,您可能需要审查
以下是commit:
由于该Web服务是基于Vue.js构建的单页面应用(SPA),其导航和内容更新机制与传统网站不同。本次适配通过使用两次监控解决问题 主要变更与实现细节:
脚本激活控制:
@match http://*/vue/index.html*规则,以兼容所有用户的本地网络环境(各类IP及端口),同时后续通过检查url来规避非开源阅读web的网站从而触发伪装。// main),通过URL路径 (/vue/index.html) 精准识别应用,将开源阅读的适配逻辑与其它网站完全隔离,避免了潜在冲突。全场景SPA导航适配 (核心):
setInterval轮询检测URL变化,并触发location.reload()强制刷新,以确保伪装被正确应用。MutationObserver(DOM) 来监控内容变化。这专门处理了URL不变而内容更新的场景(如键盘翻页),并通过刷新页面来加载新章节。setInterval(URL侦测) 来监控window.location.hash。一旦URL中不再包含#chapter,即视为用户已返回书架,脚本同样会刷新页面以彻底清除伪装界面。